//
//  FirstDetailTravelModel.m
//  BTRIP
//
//  Created by dllo on 15/11/14.
//  Copyright © 2015年 johnbk. All rights reserved.
//

#import "FirstDetailTravelModel.h"
#import "FirstSmallDetailModel.h"
@implementation FirstDetailTravelModel
- (instancetype)initWithDic:(NSDictionary *)dic{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
- (void)setValue:(id)value forKey:(NSString *)key{
    if ([key isEqualToString:@"trip_days"]) {
        NSArray *tripArray = (NSArray *)value;
        NSMutableArray *trip_daysArray = [NSMutableArray array];
        for (NSDictionary *tripDic in tripArray) {
            FirstSmallDetailModel *firstDetail = [[FirstSmallDetailModel alloc]init];
            [firstDetail setValuesForKeysWithDictionary:tripDic];
            [trip_daysArray addObject:firstDetail];
            [firstDetail release];
        }
        _trip_days = [trip_daysArray copy];
    }else{
        [super setValue:value forKey:key];
    }
}


@end
